; ModuleID = '/Users/aserlili/Documents/Codes/llvm-build/test/OllvmTest/calculate.cpp'
source_filename = "/Users/aserlili/Documents/Codes/llvm-build/test/OllvmTest/calculate.cpp"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128-Fn32"
target triple = "arm64-apple-macosx15.0.0"

%struct.StructTest = type { i32, ptr }

@.str = private unnamed_addr constant [31 x i8] c"[calculate] a=%lf,b=%lf,op=%c\0A\00", align 1
@.str.1 = private unnamed_addr constant [20 x i8] c"struct_test str=%s\0A\00", align 1
@_ZL11struct_test = internal constant %struct.StructTest { i32 2, ptr @.str }, align 8
@_Z9calculateddc_IndirectCallees = private global [1 x ptr] [ptr getelementptr (i8, ptr @printf, i64 -1616481108772997393)]
@main_IndirectCallees = private global [2 x ptr] [ptr getelementptr (i8, ptr @_Z9calculateddc, i64 5421930318831807469), ptr getelementptr (i8, ptr @printf, i64 5421930318831807469)]
@llvm.compiler.used = appending global [2 x ptr] [ptr @_Z9calculateddc_IndirectCallees, ptr @main_IndirectCallees], section "llvm.metadata"

; Function Attrs: mustprogress noinline optnone ssp uwtable(sync)
define noundef double @_Z9calculateddc(double noundef %a, double noundef %b, i8 noundef signext %op) #0 {
entry:
  %retval = alloca double, align 8
  %a.addr = alloca double, align 8
  %b.addr = alloca double, align 8
  %op.addr = alloca i8, align 1
  store double %a, ptr %a.addr, align 8
  store double %b, ptr %b.addr, align 8
  store i8 %op, ptr %op.addr, align 1
  %0 = load double, ptr %a.addr, align 8
  %1 = load double, ptr %b.addr, align 8
  %2 = load i8, ptr %op.addr, align 1
  %conv = sext i8 %2 to i32
  %call5 = load ptr, ptr @_Z9calculateddc_IndirectCallees, align 8
  %Call_printf = getelementptr i8, ptr %call5, i64 1616481108772997393
  %call = call i32 (ptr, ...) %Call_printf(ptr noundef @.str, double noundef %0, double noundef %1, i32 noundef %conv)
  %3 = load i8, ptr %op.addr, align 1
  %conv1 = sext i8 %3 to i32
  switch i32 %conv1, label %sw.default [
    i32 43, label %sw.bb
    i32 45, label %sw.bb2
    i32 42, label %sw.bb3
    i32 47, label %sw.bb4
  ]

sw.bb:                                            ; preds = %entry
  %4 = load double, ptr %a.addr, align 8
  %5 = load double, ptr %b.addr, align 8
  %add = fadd double %4, %5
  store double %add, ptr %retval, align 8
  br label %return

sw.bb2:                                           ; preds = %entry
  %6 = load double, ptr %a.addr, align 8
  %7 = load double, ptr %b.addr, align 8
  %sub = fsub double %6, %7
  store double %sub, ptr %retval, align 8
  br label %return

sw.bb3:                                           ; preds = %entry
  %8 = load double, ptr %a.addr, align 8
  %9 = load double, ptr %b.addr, align 8
  %mul = fmul double %8, %9
  store double %mul, ptr %retval, align 8
  br label %return

sw.bb4:                                           ; preds = %entry
  %10 = load double, ptr %b.addr, align 8
  %cmp = fcmp une double %10, 0.000000e+00
  br i1 %cmp, label %if.then, label %if.else

if.then:                                          ; preds = %sw.bb4
  %11 = load double, ptr %a.addr, align 8
  %12 = load double, ptr %b.addr, align 8
  %div = fdiv double %11, %12
  store double %div, ptr %retval, align 8
  br label %return

if.else:                                          ; preds = %sw.bb4
  store double -1.000000e+00, ptr %retval, align 8
  br label %return

sw.default:                                       ; preds = %entry
  store double -1.000000e+00, ptr %retval, align 8
  br label %return

return:                                           ; preds = %sw.default, %if.else, %if.then, %sw.bb3, %sw.bb2, %sw.bb
  %13 = load double, ptr %retval, align 8
  ret double %13
}

declare i32 @printf(ptr noundef, ...) #1

; Function Attrs: mustprogress noinline norecurse optnone ssp uwtable(sync)
define noundef i32 @main(i32 noundef %argc, ptr noundef %argv) #2 {
entry:
  %retval = alloca i32, align 4
  %argc.addr = alloca i32, align 4
  %argv.addr = alloca ptr, align 8
  store i32 0, ptr %retval, align 4
  store i32 %argc, ptr %argc.addr, align 4
  store ptr %argv, ptr %argv.addr, align 8
  %0 = load ptr, ptr getelementptr inbounds (%struct.StructTest, ptr @_ZL11struct_test, i32 0, i32 1), align 8
  %call5 = load ptr, ptr getelementptr ([2 x ptr], ptr @main_IndirectCallees, i64 0, i64 1), align 8
  %Call_printf = getelementptr i8, ptr %call5, i64 -5421930318831807469
  %call = call i32 (ptr, ...) %Call_printf(ptr noundef @.str.1, ptr noundef %0)
  %call16 = load ptr, ptr @main_IndirectCallees, align 8
  %Call__Z9calculateddc = getelementptr i8, ptr %call16, i64 -5421930318831807469
  %call1 = call noundef double %Call__Z9calculateddc(double noundef 0.000000e+00, double noundef 0.000000e+00, i8 noundef signext 47)
  %call27 = load ptr, ptr @main_IndirectCallees, align 8
  %Call__Z9calculateddc8 = getelementptr i8, ptr %call27, i64 -5421930318831807469
  %call2 = call noundef double %Call__Z9calculateddc8(double noundef 1.000000e+00, double noundef 2.000000e+00, i8 noundef signext 47)
  %call39 = load ptr, ptr @main_IndirectCallees, align 8
  %Call__Z9calculateddc10 = getelementptr i8, ptr %call39, i64 -5421930318831807469
  %call3 = call noundef double %Call__Z9calculateddc10(double noundef 1.000000e+00, double noundef 2.000000e+00, i8 noundef signext 43)
  %call411 = load ptr, ptr @main_IndirectCallees, align 8
  %Call__Z9calculateddc12 = getelementptr i8, ptr %call411, i64 -5421930318831807469
  %call4 = call noundef double %Call__Z9calculateddc12(double noundef 1.000000e+00, double noundef 2.000000e+00, i8 noundef signext 45)
  ret i32 0
}

attributes #0 = { mustprogress noinline optnone ssp uwtable(sync) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz" }
attributes #1 = { "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz" }
attributes #2 = { mustprogress noinline norecurse optnone ssp uwtable(sync) "frame-pointer"="non-leaf" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="apple-m1" "target-features"="+aes,+altnzcv,+ccdp,+ccidx,+complxnum,+crc,+dit,+dotprod,+flagm,+fp-armv8,+fp16fml,+fptoint,+fullfp16,+jsconv,+lse,+neon,+pauth,+perfmon,+predres,+ras,+rcpc,+rdm,+sb,+sha2,+sha3,+specrestrict,+ssbs,+v8.1a,+v8.2a,+v8.3a,+v8.4a,+v8a,+zcm,+zcz" }

!llvm.module.flags = !{!0, !1, !2, !3, !4}
!llvm.ident = !{!5}

!0 = !{i32 2, !"SDK Version", [2 x i32] [i32 15, i32 5]}
!1 = !{i32 1, !"wchar_size", i32 4}
!2 = !{i32 8, !"PIC Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 1}
!4 = !{i32 7, !"frame-pointer", i32 1}
!5 = !{!"clang version 19.1.3 (git@github.com:zylc369/Arkari.git 24bfb07f833b071be7f479a9c313737656a4ff37)"}
